package spring.context;

import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringContext {	
	public static ApplicationContext getContext() {
		ApplicationContext applicationContext =
				new ClassPathXmlApplicationContext("spring-conf.xml") {
			public ClassLoader getClassLoader() {
				return getClass().getClassLoader();
			}

			protected void initBeanDefinitionReader(
					XmlBeanDefinitionReader reader) {
				super.initBeanDefinitionReader(reader);
				reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_NONE);
				reader.setBeanClassLoader(getClassLoader());
			}
		};		
		return applicationContext;
	}
}
